﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<string>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>EditPwdInfo</title>
    <script src="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Scripts/jquery-1.4.1.min.js") %>" type="text/javascript"></script>
    <link href="../../Content/back/css/skin.css" rel="stylesheet" type="text/css" />   
    <script type="text/javascript">
        function submitForm() {

            $("form:first").submit();
        }
        function PwdIsExit() {
            $.ajax({
                url: "/User/PwdIsExit",
                type: "post",
                cache: false,
                data: "userId=" + $("#userId").val() + "&password=" + $("#oldPwd").val(),
                success: function (result) {
                    if (result == 'True') {
                        $("#oldPwdOk").html('<font color="Green">旧密码输入正确！</font>');
                    } else {
                        $("#oldPwdOk").html('<font color="red">旧密码输入有误，请再次输入</font>');
                        $("#oldPwd").val('');
                    }
                }
            });
        }

        function SubmitForm() {
            if ($("#oldPwd").val() == '') {
                alert("请输入旧密码……");
                return;
            } else {
                $.ajax({
                    url: "/User/EditPwdInfo",
                    type: "post",
                    cache: false,
                    data: "userId=" + $("#userId").val() + "&password=" + $("#newPwd").val(),
                    success: function (result) {
                        if (result == "1") {
                            alert("密码修改成功！");
                            window.location.href = "/User/InfoList";
                        } else if (result == "2") {
                            alert("密码修改发生异常！");
                        } else if (result == "0") {
                            alert("密码修改失败！");
                        }
                    }
                });
            }
        }
        function reSet() {
            $("#oldPwd").val('');
            $("#newPwd").val('');
            $("#reNewPwd").val('');
        }
</script>
</head>
<body>
    <div>
 <input type="hidden" id="userId" value="<%:HttpContext.Current.Session["userId"].ToString() %>"/>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" height="29" valign="top" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_leftbg.gif") %>"><img src="<%=Url.Content

(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/left-top-right.gif") %>" width="17" height="29" /></td>
    <td width="100%" height="29" valign="top" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/content-bg.gif") %>"><table width="100%" 

height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">用户信息</div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_rightbg.gif") %>"><img src="<%=Url.Content

(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/nav-right-bg.gif") %>" width="16" height="29" /></td>
  </tr>

  <tr>
    <td height="71" valign="middle" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_leftbg.gif") %>">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9"><table border="0" cellpadding="0" cellspacing="0"> 
     <tr>
            <td class="left_txt">当前位置：修改<span style="margin:0px 10px 0px 10px;color:Green;"><%:kysec.Bll.User.common.getUserNameById(HttpContext.Current.Request

["id"].ToString()) %></span>密码</td>
      </tr></table>
   <div style="background-color:#97b9f0;min-height:1px;margin-bottom:10px;"></div>

        <div style="text-align:center;">
            <div style="margin-top:10px;">
            <table border="0" cellpadding="1" cellspacing="0" width="100%" >
            <tr  style="height:50px;" bgcolor="#d3ebf8">
                <td width="10%" ><div><label>旧&nbsp;密&nbsp;码:</label></div></td>
                <td width="30%" align="left"><div class="td_Left"><input type="password" size="22" id="oldPwd" name="oldPwd" onblur="PwdIsExit()"/></div></td>       
                <td align="left"><div id="oldPwdOk" class="td_Left">请输入旧密码</div></td>         
            </tr>
            
            <tr style="height:50px;" bgcolor="#97b9f0">
                <td width="10%"><div><label>新&nbsp;密&nbsp;码:</label></div> </td>
                <td width="30%" align="left"><div class="td_Left"><input type="password" size="22" id="newPwd" name="newPwd"/></div></td>                           <td 

align="left"><div class="td_Left">请输入密码</div></td>
            </tr>   
                   
            <tr style="height:50px;"  bgcolor="#d3ebf8">
                <td><div><label>确认密码:</label></div></td>
                <td align="left"><div class="td_Left"><input type="password" size="22" id="reNewPwd" name="reNewPwd"/></div></td>
                <td align="left"><div class="tb_Left">请再次输入密码</div></td>
            </tr></table>
            </div>            	
            <p>
                <a href="javascript:;" onclick="SubmitForm()">确认</a>

                <a href="JavaScript:;" onclick="reSet()" style="margin:0px 20px 0px 20px;">重置</a>

                <a href="<%=kysec.CR.MyUrl.WebData.WEBURL %>/User/InfoList">返回</a>
            </p>
        </div>
     </td>
    <td background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_rightbg.gif") %>">&nbsp;</td>
  </tr>
  <tr>
    <td valign="middle" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_leftbg.gif") %>"><img src="<%=Url.Content

(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/buttom_left2.gif") %>" width="17" height="17" /></td>
      <td  valign="top" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/buttom_bgs.gif") %>"><img src="<%=Url.Content

(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/buttom_bgs.gif") %>" width="17" height="17" /></td>
    <td background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_rightbg.gif") %>"><img src="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + 

"/Content/back/images/buttom_right2.gif") %>" width="16" height="17" /></td>
  </tr>
</table>   
    </div>
</body>
</html>
